package com.xijia;


/**
 * 饿汉式
 * @author wangsong
 * @mail 1720696548@qq.com
 * @date 2020/9/5 0005 10:12
 * @version 1.0.0
 */
public class Singleton04 {

    /**
     * 当class文件被加载的时候就创建该对象，常用于创建常量
     */
    public static final Singleton04 singleton04 = new Singleton04();

    private Singleton04() {
    }

    public static void main(String[] args) {
        System.out.println(Singleton04.singleton04 == Singleton04.singleton04);
    }

}
